package com.hundsun.cprs.yyt.service.dilivery.enums;

import java.util.HashMap;
import java.util.Map;

public enum EnumDeliveryStatus {
	
	PENDING_DELIVERY("1","待发货"),
	COMPELTED("2","已发货"),
	RECEIVING("3","已收货");
	;
	/** 状态值 */
	private String code;
	/** 状态值说明 */
	private String desc;

	private EnumDeliveryStatus(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	/**
	 * 全局索引池
	 */
	private static Map<String, EnumDeliveryStatus> pool = new HashMap<String, EnumDeliveryStatus>();
	static {
		for (EnumDeliveryStatus et : EnumDeliveryStatus.values()) {
			pool.put(et.code + "", et);
		}
	}

	/**
	 * 根据内容索引
	 * 
	 * @param code
	 * @return
	 */
	public static EnumDeliveryStatus indexByValue(String code) {
		return pool.get(code);
	}
	
	public static Map<String, EnumDeliveryStatus> toMap() {
		return pool;
	}

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
}
